﻿
@page "/components/scrolltotop"

<DocsPage>
    <DocsPageHeader Title="Scroll To Top" SubTitle="A ScrollToTop component is a component that allows the user to return to the top of the page without making too much effort" />
    <DocsPageContent>
        <DocsPageSection>
            <SectionHeader>
                <Title>Default values</Title>
                <Description>
                    If your website follows a normal flow and you have not limited the body or html height, <b>you will not need to do anything</b> to configure it, and the component will behave like the one you've probably already noticed on our website. If you put it at the layout level, it will run on all the pages of your site.
                </Description>
            </SectionHeader>
            <SectionSource ShowCode="true" Code="DefaultScrollToTopExample" GitHubFolderName="ScrollToTop" NoToolbar="true" />
        </DocsPageSection>

        <DocsPageSection>
            <SectionHeader>
                <Title>Setup</Title>
                <Description> If the element you want to scroll is other than the root element, you can specify it with the <CodeInline>Selector</CodeInline> property. In this example, we are going to scroll in the container marked with the selector <CodeInline>#unique_id_scroll_section</CodeInline>. Notice how the button that appears at the bottom right of this container when you scroll changes its color.</Description>
            </SectionHeader>
            <SectionContentBlock>
            </SectionContentBlock>
            <SectionContent DisplayFlex="true" DarkenBackground="true">
                <MudContainer Style="padding:20px;">
                    <ScrollToTopExample />
                </MudContainer>
            </SectionContent>
            <SectionSource ShowCode="false" Code="ScrollToTopExample" GitHubFolderName="ScrollToTop" />
        </DocsPageSection>

        <DocsPageSection>
            <SectionHeader>
                <Title>Custom content</Title>
                <Description>In the example above, we have used a MudButton as a trigger for the back to top action, but we could have used pretty much anything. The root element of the component is just a transparent span element that allows you to use anything inside. In the next example we show you how to use a custom button, with custom transitions to show and hide.</Description>
            </SectionHeader>
            <SectionContent DisplayFlex="true" DarkenBackground="true">
                <MudContainer Style="padding:20px;">
                    <CustomScrollToTopExample />
                </MudContainer>
            </SectionContent>
            <SectionSource ShowCode="false" Code="CustomScrollToTopExample" GitHubFolderName="ScrollToTop" />
        </DocsPageSection>
    </DocsPageContent>
</DocsPage>


